package com.lcpress.service.impl;

import static org.hamcrest.CoreMatchers.nullValue;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
//import com.lcpress.dao.ArticleMapper;
import com.lcpress.entity.Article;
import com.lcpress.mapper.ArticleMapper;

@Service
public class Admin_ArticleServiceImpl implements IService<Article> {
	
	@Autowired
	ArticleMapper aMapper;
	
	//获取指定页码文章
	public List<Article> getArticlesByPage(int page,int limit){
		
		int start=(page-1)*limit;
		int end=start+limit;
		
		//List<Article> articles=aMapper.getArticlesByPage(start, end);
		
		return null;
	}
	
	//添加文章
	public int addArticle(String title,String content){
		
		return 1;
				//aMapper.add(title, content);
	}

	@Override
	public boolean saveBatch(Collection<Article> entityList, int batchSize) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean saveOrUpdateBatch(Collection<Article> entityList, int batchSize) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean updateBatchById(Collection<Article> entityList, int batchSize) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean saveOrUpdate(Article entity) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Article getOne(Wrapper<Article> queryWrapper, boolean throwEx) {
		
		Article article=aMapper.selectOne(queryWrapper);
		
		return article;
	}

	@Override
	public Map<String, Object> getMap(Wrapper<Article> queryWrapper) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <V> V getObj(Wrapper<Article> queryWrapper, Function<? super Object, V> mapper) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public BaseMapper<Article> getBaseMapper() {

		return aMapper;
	}

	@Override
	public Class<Article> getEntityClass() {
		// TODO Auto-generated method stub
		return null;
	}
	
}
